package com.fxp.project.jiuselu.web.models.order.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.fxp.project.jiuselu.web.models.goods.entity.JslGoods;
import com.fxp.project.jiuselu.web.models.goods.mapper.JslGoodsMapper;
import com.fxp.project.jiuselu.web.models.order.entity.SplitOrder;
import com.fxp.project.jiuselu.web.models.order.mapper.SplitOrderMapper;
import com.fxp.project.jiuselu.web.models.order.service.ISplitOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Arrays;
import java.util.List;


/**
 * 拆分发货Service业务层处理
 *
 * @author Jason.Wang
 * @date 2022-06-15
 */
@Service
public class SplitOrderServiceImpl extends ServiceImpl<SplitOrderMapper, SplitOrder> implements ISplitOrderService
{
    @Autowired
    private SplitOrderMapper splitOrderMapper;

    /**
     * 查询拆分发货
     *
     * @param id 拆分发货主键
     * @return 拆分发货
     */
    @Override
    public SplitOrder selectSplitOrderById(Long id)
    {
        return splitOrderMapper.selectSplitOrderById(id);
    }

    /**
     * 查询拆分发货列表
     *
     * @param splitOrder 拆分发货
     * @return 拆分发货
     */
    @Override
    public List<SplitOrder> selectSplitOrderList(SplitOrder splitOrder)
    {
        return splitOrderMapper.selectSplitOrderList(splitOrder);
    }

    /**
     * 通过orderId查询第一条物流信息
     * @param orderId
     * @return
     */
    @Override
    public SplitOrder selectSplitOrderByOrderId(String orderId) {
        return splitOrderMapper.selectSplitOrderByOrderId(orderId);
    }


//    /**
//     * 修改拆分发货
//     *
//     * @param splitOrder 拆分发货
//     * @return 结果
//     */
//    @Override
//    public int updateSplitOrder(SplitOrder splitOrder)
//    {
//        splitOrder.setUpdateTime(DateUtils.getNowDate());
//        return splitOrderMapper.updateSplitOrder(splitOrder);
//    }

    /**
     * 批量删除拆分发货
     *
     * @param ids 需要删除的拆分发货主键
     * @return 结果
     */
    @Override
    public int deleteSplitOrderByIds(Long[] ids)
    {
        return splitOrderMapper.deleteSplitOrderByIds(ids);
    }

    /**
     * 删除拆分发货信息
     *
     * @param id 拆分发货主键
     * @return 结果
     */
    @Override
    public int deleteSplitOrderById(Long id)
    {
        return splitOrderMapper.deleteSplitOrderById(id);
    }
}
